import { defineStore } from 'pinia'
import { ref } from 'vue'

const initState = {}

export const useMessageNumStore = defineStore(
  'messageNum',
  () => {
    const messageNum = ref<any>({ ...initState })
    const setMessageNum = (val: any) => {
      messageNum.value = val
    }
    const clearMessageNum = () => {
      messageNum.value = { ...initState }
      uni.clearStorageSync()
    }

    return {
      messageNum,
      setMessageNum,
      clearMessageNum,
    }
  },
  {
    persist: true,
  },
)
